#include <iostream>
#include <cstdlib>
using namespace std;

const int N = 110;

int n,a[N];

int main(){
	cin >> n;
	for(int i = n;i >= 0;i--){
		cin >> a[i];
	}
	for(int i = n;i >= 0;i--){
		if(a[i] == 0) continue;
		if(a[i] > 0 && i != n) cout << '+';
		else if(a[i] < 0) cout << '-';
		if(a[i] != 1 && a[i] != -1 || i == 0) cout << abs(a[i]);
		if(i != 0){
			cout << 'x';
			if(i != 1) cout << '^' << i;
		}
	}
	return 0;
}
